import request from "@/api/request.js";
//首页接口

// 添加用户

export function addUser(params) {
	return request.post("/user/addUser", params, {
		header: {
			'Content-Type': 'application/json;charset=UTF-8',
			'Accept': '*/*',
			'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
		}
	});
}

// 根据id获取用户
export function getUserById(params) {
	return request.get(`/user/getByUser`, {
		params: params
	});
}

// 添加任务
export function addTask(params) {
	return request.post("/api/addTask", params, {
		header: {
			'Content-Type': 'application/json;charset=UTF-8',
			'Accept': '*/*',
			'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
		}
	})
}
// 删除任务
export function delTask(params) {
	return request.post("/api/cancelTask", params, {
		header: {
			'Content-Type': 'application/json;charset=UTF-8',
			'Accept': '*/*',
			'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
		}
	})
}


// 获取用户列表
export function getUserList() {
	return request.get("/user/getAllUser")
}
// 获取任务列表
export function getTaskList(params) {
	return request.get("/api/getTaskList", {
		params: params
	})
}